package com.oa.ylms.apps.actions.archives;

import java.io.ByteArrayOutputStream;
import java.io.DataOutput;
import java.io.DataOutputStream;
import java.io.File;
import java.io.FileInputStream;
import java.io.InputStream;
import java.util.Calendar;
import java.util.List;

import org.apache.struts2.ServletActionContext;

import net.sf.json.JSONObject;

import com.itextpdf.text.Document;
import com.itextpdf.text.Element;
import com.itextpdf.text.Font;
import com.itextpdf.text.Image;
import com.itextpdf.text.PageSize;
import com.itextpdf.text.Paragraph;
import com.itextpdf.text.pdf.BaseFont;
import com.itextpdf.text.pdf.PdfPCell;
import com.itextpdf.text.pdf.PdfPTable;
import com.itextpdf.text.pdf.PdfWriter;
import com.oa.ylms.apps.actions.BasicAction;
import com.oa.ylms.apps.business.archives.IArchiveInfoService;
import com.oa.ylms.apps.business.archives.IAvatarInfoService;
import com.oa.ylms.apps.business.archives.IMailInfoService;
import com.oa.ylms.apps.business.archives.IMajorInfoService;
import com.oa.ylms.apps.business.archives.IRPCategoryService;
import com.oa.ylms.apps.business.archives.IRPInfoService;
import com.oa.ylms.apps.business.archives.IRecordInfoService;
import com.oa.ylms.apps.business.archives.IStaffInfoService;
import com.oa.ylms.apps.business.organization.IPostInfoService;
import com.oa.ylms.apps.business.organization.ISectionInfoService;
import com.oa.ylms.apps.common.DateUtil;
import com.oa.ylms.apps.common.InputStream2Byte;
import com.oa.ylms.apps.constants.IDEDStates;
import com.oa.ylms.apps.constants.IRPCategoryStates;
import com.oa.ylms.apps.constants.IRecordCategroyStates;
import com.oa.ylms.apps.entity.archives.MajorInfoValue;
import com.oa.ylms.apps.entity.archives.RPCategoryValue;
import com.oa.ylms.apps.entity.archives.RPInfoValue;
import com.oa.ylms.apps.entity.archives.RecordInfoValue;
import com.oa.ylms.apps.entity.archives.StaffInfoValue;
import com.oa.ylms.apps.entity.organization.PostInfoValue;
import com.oa.ylms.apps.entity.organization.SectionInfoValue;

@SuppressWarnings("serial")
public class ArchivesInfoAction extends BasicAction {
	private List<SectionInfoValue> sectionList;
	private List<MajorInfoValue> majorList;
	private List<PostInfoValue> postList;
	private List<StaffInfoValue> staffList;
	private List<RPInfoValue> rewardList;
	private List<RPInfoValue> punishList;
	private List<RecordInfoValue> recordList;
	private List<RPCategoryValue> rpCategoryList;
 	private ISectionInfoService sectionService;
	private IPostInfoService postService;
	private IMajorInfoService majorService;
	private IAvatarInfoService avatarService;
	private IMailInfoService mailService;
	private IArchiveInfoService archiveService;
	private IStaffInfoService staffService;
	private IRecordInfoService recordService;
	private IRPInfoService rpService;
	private IRPCategoryService rpCategoryService;
	
	private Integer sectionId;
	private String sectionName;
	private Integer postId;
	private String postName;
	private Integer majorId;
	private String majorName;
	private String staffNo;
	private String archiveNo;
	private String staffName;
	private String gender;
	private Integer age;
	private String birthday;
	private String politician;
	private String grade;
	private String classNo;
	private String telphone;
	private Integer mailId;
	private String mail;
	private String dormitory;
	private String staffPwd;
	private Integer avatarId;
	private Integer staffId;
	private Integer archiveId;
	private Integer isRP;
	private Integer rpInfoCategory;
	private String createTime;
	private String contents;
	private Integer rpId;
	private Integer recordId;
	
	private String rpInfoJsonString;
	private String staffPwdJsonString;

	private File staffPhoto;
	private String staffPhotoContentType;
	private String staffPhotoFileName;

	private String str;

	@Override
	public String execute() throws Exception {
		majorList = majorService.queryALLMajorInfo();
		sectionList = sectionService.querySectionInfo(null, IDEDStates.ENABLE);
		return "show";
	}
	
	public String queryRPInfoByIsRP() throws Exception {
		if (isRP != null) {
			rpCategoryList = rpCategoryService.queryRPCategory(isRP, IDEDStates.ENABLE);
			response.setContentType("text/html; charset=UTF-8");
			response.setHeader("Cache-Control", "no-cache");
			this.str = getRPInfoOptionsFrom(rpCategoryList); // obj.toString();
			response.getWriter().print(str);
		}
		return null;
	}

	public String getRPInfoOptionsFrom(List<RPCategoryValue> list) {
		StringBuilder sb = new StringBuilder();
		sb.append("<option value=\"\">-请选择-</option>");
		for (RPCategoryValue rpcv : list) {
			String temp = "<option value=\"" + rpcv.getCategoryId().toString()
					+ "\">" + rpcv.getCategoryName() + "</option>";

			sb.append(temp);
		}
		return sb.toString();
	}
	
	public String queryPostBySection() throws Exception {
		if (sectionId != null) {
			postList = postService.queryPostInfoBySectionId(sectionId);
			response.setContentType("text/html; charset=UTF-8");
			response.setHeader("Cache-Control", "no-cache");
			this.str = getPostOptionsFrom(postList); // obj.toString();
			response.getWriter().print(str);
		}
		return null;
	}

	public String getPostOptionsFrom(List<PostInfoValue> list) {
		StringBuilder sb = new StringBuilder();
		sb.append("<option value=\"-1\">-请选择-</option>");
		for (PostInfoValue piv : list) {
			String temp = "<option value=\"" + piv.getPostId().toString()
					+ "\">" + piv.getPostName() + "</option>";

			sb.append(temp);
		}
		return sb.toString();
	}
	
	public String queryStaffBySection() throws Exception{
		if (sectionId != null) {
			staffList = staffService.queryStaffInfoBySectionId(sectionId);
			response.setContentType("text/html; charset=UTF-8");
			response.setHeader("Cache-Control", "no-cache");
			this.str = getStaffOptionsFrom(staffList); // obj.toString();
			response.getWriter().print(str);
		}
		return null;
	}
	
	public String getStaffOptionsFrom(List<StaffInfoValue> list) {
		StringBuilder sb = new StringBuilder();
		sb.append("<option value=\"\">-请选择-</option>");
		for (StaffInfoValue siv : list) {
			String temp = "<option value=\"" + siv.getStaffId().toString()
					+ "\">" + siv.getArchiveInfo().getStaffName() + "</option>";

			sb.append(temp);
		}
		return sb.toString();
	}

	public String add() throws Exception {
		staffPwd = "123456";
		staffInfo = (StaffInfoValue)session.get("login_staffInfo");
		int avatarId = avatarService.addAvatarInfo(null, 0, null);
		int mailId = mailService.addMailInfo(mail);
		if (avatarId != 0 && mailId != 0) {
			int archiveId = archiveService.addArchiveInfo(mailId, majorId,
					avatarId, postId, staffName, gender, age, birthday,
					politician, grade, classNo, telphone, dormitory, archiveNo);
			if (archiveId != 0) {
				if (staffService.addStaffInfo(archiveId, staffNo, staffPwd) != 0) {
					String messages ="入职记录：该人员入职到" + postService.queryByPostId(postId).getSectionInfo().getSectionName()+"部门, 操作者："+staffInfo.getArchiveInfo().getStaffName();
					recordService.addRecordInfo(IRecordCategroyStates.ON, archiveId, messages);
					str= "SUCCESS!";
					return clear();
				}
				return "false";
			}
		}
		return "false";
	}

	public String addPhoto() throws Exception{
		FileInputStream fis = null;
		try{
			if(staffPhoto != null && avatarId != null){
				fis = new FileInputStream(staffPhoto);
				int avatarSize = (int)staffPhoto.length();
				avatarService.modifyAvatarInfo(avatarId, fis, avatarSize, staffPhotoContentType);//
			}
		}finally{
			fis.close();
		}
		return "toModifyByManager";
	}
	
	public String modifyByPerson() throws Exception{
//		mailService.sendMail(101);
		majorList = majorService.queryALLMajorInfo();
		staffInfo = (StaffInfoValue)session.get("login_staffInfo");
		majorId = staffInfo.getArchiveInfo().getMajorInfo().getMajorId();
		politician = staffInfo.getArchiveInfo().getPolitician();
		birthday = DateUtil.toStringWithoutHours(staffInfo.getArchiveInfo().getBirthday());
		return "modifyByPerson";
	}
	
	public String modifyInfoByPerson() throws Exception{
		if(archiveService.modifyArchiveInfo(archiveId, majorId, staffName, age, politician, grade, classNo, telphone, dormitory, mailId, mail)){
			staffInfo = staffService.queryByStaffId(staffId);
			session.put("login_staffInfo", staffInfo);
		return "toModifyByPerson";
		}
		return "false";
	}
	
	public String modifyByManager() throws Exception{
		sectionList = sectionService.querySectionInfo(null, IDEDStates.ENABLE);
		majorList = majorService.queryALLMajorInfo();
		if(staffId != null){
			staffInfo = staffService.queryByStaffId(staffId);
			queryInfoList();
			assignValue(staffInfo);
		}
		return "modifyByManager";
	}
	
	public String modifyInfoByManager() throws Exception{
		if(staffService.modifyStaffInfo(staffId, staffNo)&&archiveService.modifyArchiveInfo(archiveId, majorId, staffName, age, birthday, politician, grade, classNo, telphone, dormitory, archiveNo)){
			staffInfo = staffService.queryByStaffId(staffId);
			assignValue(staffInfo);
			sectionList = sectionService.querySectionInfo(null, IDEDStates.ENABLE);
			majorList = majorService.queryALLMajorInfo();
			queryInfoList();
			return "modifyByManager";
		}
		return "false";
	}
	
	public String queryByPerson() throws Exception{
		staffInfo = (StaffInfoValue)session.get("login_staffInfo");
		birthday = DateUtil.toStringWithoutHours(staffInfo.getArchiveInfo().getBirthday());
		queryInfoList();
		return "queryByPerson";
	}
	
	public String queryByManager() throws Exception{
		sectionList = sectionService.querySectionInfo(null, IDEDStates.ENABLE);
		if(staffId != null){
			staffInfo = staffService.queryByStaffId(staffId);
			queryInfoList();
			assignValue(staffInfo);
		}
		return "queryByManager";
	}
	
	public String addRPInfo() throws Exception{
		try {
			JSONObject json =   JSONObject.fromObject(rpInfoJsonString);
			if(!json.get("staffId").equals("")){
				staffId = json.getInt("staffId");
			}
			if(!json.get("archiveId").equals("")){
				archiveId= json.getInt("archiveId");
			}
			if(!json.get("rpInfoCategory").equals("")){
				rpInfoCategory = json.getInt("rpInfoCategory");;
			}
			if(!json.get("createTime").equals("")){
				createTime = json.getString("createTime");
			}
			if(!json.get("contents").equals("")){
				contents= json.getString("contents");
			}
			if(archiveId != null){
				rpService.addRPInfo(rpInfoCategory, createTime, archiveId, contents);
			}
		} catch (Exception e) {
			return "false";
		}
		return null;
	}
	
	public String verifyStaffNo() throws Exception{
		if(staffService.verifyStaffInfo(staffNo, null) != null)
			str = "1";
		else 
			str = "0";
		response.setContentType("text/html; charset=UTF-8");
		response.setHeader("Cache-Control", "no-cache");
		response.getWriter().print(str);
		return null;
	}
	
	public String queryArchiveNo() throws Exception{
		Calendar cal = Calendar.getInstance(); 
		int year = cal.get(Calendar.YEAR);
		archiveNo = "DA"+year+"%";
		String max_archiveNo = archiveService.queryArchiveNo(archiveNo);
		if(max_archiveNo != null){
			max_archiveNo = max_archiveNo.substring(2);
			archiveNo = "DA"+(Integer.parseInt(max_archiveNo)+1);
		}else{
			archiveNo = "DA"+year+"001";
		}
		response.setContentType("text/html; charset=UTF-8");
		response.setHeader("Cache-Control", "no-cache");
		response.getWriter().print(archiveNo);
		return null;
	}
	
	public String verifyArchiveNo() throws Exception{
		archiveNo = archiveService.queryArchiveNo(archiveNo);
		if(archiveNo != null){
			str = "1";
		}else{
			str = "0";
		}
		response.setContentType("text/html; charset=UTF-8");
		response.setHeader("Cache-Control", "no-cache");
		response.getWriter().print(str);
		return null;
	}
	
	public String deleteRPInfo() throws Exception{
		if(rpService.deleteRPInfo(rpId)){
			return "deleteRPInfo";
		}
		return "false";
	}
	
	public String deleteRecordInfo() throws Exception{
		if(recordService.deleteRecordInfo(recordId)){
			return "deleteRecordInfo";
		}
		return "false";
	}
	
	public String modifyPwd() throws Exception{
		System.out.println("111");
		String newStaffPwd = null;
		staffInfo = (StaffInfoValue)session.get("login_staffInfo");
		try {
			JSONObject json = JSONObject.fromObject(staffPwdJsonString);
			if(!json.get("staffPwd").equals("")){
				staffPwd = json.getString("staffPwd");
			}
			if(!json.get("newStaffPwd").equals("")){
				newStaffPwd= json.getString("newStaffPwd");
			}
			if(staffInfo.getStaffPwd().equals(staffPwd)){
				if(staffService.modifyStaffPwd(staffInfo.getStaffId(), newStaffPwd)){
					str ="1";
				}else{
					str="-1";
				}
			}else{
				str="0";
			}
			response.setContentType("text/html; charset=UTF-8");
			response.setHeader("Cache-Control", "no-cache");
			response.getWriter().write(str);
		} catch (Exception e) {
			return "false";
		}
		return null;
	}
	
	private void queryInfoList() throws Exception{
		recordList = recordService.queryRecordInfo(null, staffInfo.getArchiveInfo().getArchiveId());
		rewardList = rpService.queryRPInfo(null,staffInfo.getArchiveInfo().getArchiveId(),IRPCategoryStates.REWARD);
		punishList = rpService.queryRPInfo(null,staffInfo.getArchiveInfo().getArchiveId(),IRPCategoryStates.PUNISH);
	}
	
	private void assignValue(StaffInfoValue staffInfo) throws Exception{
		sectionName = staffInfo.getArchiveInfo().getPostInfo().getSectionInfo().getSectionName();
		postName = staffInfo.getArchiveInfo().getPostInfo().getPostName();
		majorId = staffInfo.getArchiveInfo().getMajorInfo().getMajorId();
		majorName = staffInfo.getArchiveInfo().getMajorInfo().getMajorName();
		staffNo = staffInfo.getStaffNo();
		staffPwd = staffInfo.getStaffPwd();
		archiveNo = staffInfo.getArchiveInfo().getArchiveNo();
		staffName = staffInfo.getArchiveInfo().getStaffName();
		gender = staffInfo.getArchiveInfo().getGender();
		age = staffInfo.getArchiveInfo().getAge();
		birthday = DateUtil.toStringWithoutHours(staffInfo.getArchiveInfo().getBirthday());
		politician = staffInfo.getArchiveInfo().getPolitician();
		grade = staffInfo.getArchiveInfo().getGrade();
		classNo = staffInfo.getArchiveInfo().getClassNo();
		telphone = staffInfo.getArchiveInfo().getTelphone();
		mailId= staffInfo.getArchiveInfo().getMailInfo().getMailId();
		mail = staffInfo.getArchiveInfo().getMailInfo().getMail();
		dormitory = staffInfo.getArchiveInfo().getDormitory();
		archiveId = staffInfo.getArchiveInfo().getArchiveId();
		staffId = staffInfo.getStaffId();
		avatarId = staffInfo.getArchiveInfo().getAvatarInfo().getAvatarId();
	}

	private String clear() throws Exception {
		sectionName = null;
		postName = null;
		majorId = null;
		majorName = null;
		staffNo = null;
		staffPwd = null;
		archiveNo = null;
		staffName = null;
		gender = null;
		age = null;
		birthday = null;
		politician = null;
		grade = null;
		classNo = null;
		telphone = null;
		mailId= null;
		mail = null;
		dormitory = null;
		archiveId = null;
		staffId = null;
		avatarId = null;
		contents = null;
		rpId = null;
		return "add";
	}
	
	public String export() throws Exception{
		staffInfo = staffService.queryByStaffId(staffId);
		response.reset();
		response.setContentType("application/pdf");
		response.setCharacterEncoding("UTF-8");
		response.setHeader("Content-Disposition","attachment;filename="+new String((staffInfo.getArchiveInfo().getStaffName()+"的个人档案").getBytes("gb2312"), "ISO8859-1")+".pdf");
		Document document = new Document(PageSize.A4);
		BaseFont bfChinese = BaseFont.createFont("STSong-Light","UniGB-UCS2-H",BaseFont.NOT_EMBEDDED);
		Font fontCN = new Font(bfChinese, 10,Font.NORMAL);
		Font fontCNTitle = new Font(bfChinese, 12,Font.BOLD);
		Image image = null;
		if(staffInfo.getArchiveInfo().getAvatarInfo().getAvatarImage() != null){
			InputStream imageStream = staffInfo.getArchiveInfo().getAvatarInfo().getAvatarImage().getBinaryStream();
			image = Image.getInstance(InputStream2Byte.getBytes(imageStream));
			image.setAlignment(Image.MIDDLE);
			image.scalePercent(20, 20);
		}
		PdfPTable table = new PdfPTable(new float[] { .8f, 1.4f, .8f, 1.2f, 1.2f });
		PdfPCell cell;
		cell = new PdfPCell(new Paragraph("个人档案",fontCNTitle));
		cell.setHorizontalAlignment(Element.ALIGN_CENTER);
		cell.setColspan(5);
		table.addCell(cell);
		table.setHeaderRows(1);
		table.addCell(new Paragraph("学号",fontCN));
		table.addCell(new Paragraph(staffInfo.getStaffNo(),fontCN));
		table.addCell(new Paragraph("档案编号",fontCN));
		table.addCell(new Paragraph(staffInfo.getArchiveInfo().getArchiveNo(),fontCN));
		if(image != null){
			cell = new PdfPCell(image);
			cell.setHorizontalAlignment(Element.ALIGN_CENTER);
			cell.setPaddingTop(100);
			cell.setRowspan(8);
			table.addCell(cell);
		}else{
			cell = new PdfPCell(new Paragraph("照片粘贴处",fontCN));
			cell.setHorizontalAlignment(Element.ALIGN_CENTER);
			cell.setVerticalAlignment(Element.ALIGN_MIDDLE);
			cell.setRowspan(8);
			table.addCell(cell);
		}
		table.addCell(new Paragraph("姓名",fontCN));
		table.addCell(new Paragraph(staffInfo.getArchiveInfo().getStaffName(),fontCN));
		table.addCell(new Paragraph("性别",fontCN));
		table.addCell(new Paragraph(staffInfo.getArchiveInfo().getGender(),fontCN));
		table.addCell(new Paragraph("年龄",fontCN));
		table.addCell(new Paragraph(staffInfo.getArchiveInfo().getAge().toString(),fontCN));
		table.addCell(new Paragraph("生日",fontCN));
		table.addCell(new Paragraph(staffInfo.getArchiveInfo().getStrBirthday(),fontCN));
		table.addCell(new Paragraph("政治面貌",fontCN));
		table.addCell(new Paragraph(staffInfo.getArchiveInfo().getPolitician(),fontCN));
		table.addCell(new Paragraph("年级",fontCN));
		table.addCell(new Paragraph(staffInfo.getArchiveInfo().getGrade(),fontCN));
		table.addCell(new Paragraph("专业",fontCN));
		table.addCell(new Paragraph(staffInfo.getArchiveInfo().getMajorInfo().getMajorName(),fontCN));
		table.addCell(new Paragraph("班级",fontCN));
		table.addCell(new Paragraph(staffInfo.getArchiveInfo().getClassNo(),fontCN));
		table.addCell(new Paragraph("联系电话",fontCN));
		table.addCell(new Paragraph(staffInfo.getArchiveInfo().getTelphone(),fontCN));
		table.addCell(new Paragraph("人员邮箱",fontCN));
		table.addCell(new Paragraph(staffInfo.getArchiveInfo().getMailInfo().getMail(),fontCN));
		table.addCell(new Paragraph("寝室地址",fontCN));
		table.addCell(new Paragraph(staffInfo.getArchiveInfo().getDormitory(),fontCN));
		table.addCell(new Paragraph("",fontCN));
		table.addCell(new Paragraph("",fontCN));
		table.addCell(new Paragraph("所属部门",fontCN));
		table.addCell(new Paragraph(staffInfo.getArchiveInfo().getPostInfo().getSectionInfo().getSectionName(),fontCN));
		table.addCell(new Paragraph("所属职位",fontCN));
		table.addCell(new Paragraph(staffInfo.getArchiveInfo().getPostInfo().getPostName(),fontCN));

		rewardList = rpService.queryRPInfo(null,staffInfo.getArchiveInfo().getArchiveId(),IRPCategoryStates.REWARD);
		punishList = rpService.queryRPInfo(null,staffInfo.getArchiveInfo().getArchiveId(),IRPCategoryStates.PUNISH);
		if(rewardList == null || rewardList.size() ==0){
			cell = new PdfPCell(new Paragraph("奖励情况",fontCN));
			table.addCell(cell);
			cell = new PdfPCell(new Paragraph("无记录",fontCN));
			cell.setColspan(4);
			table.addCell(cell);
		}else{
			cell = new PdfPCell(new Paragraph("奖励情况",fontCN));
			cell.setRowspan(rewardList.size());
			table.addCell(cell);
			for(RPInfoValue rpInfo:rewardList){
				cell = new PdfPCell(new Paragraph(rpInfo.getStrCreateTime()+"  "+rpInfo.getContents(),fontCN));
				cell.setColspan(4);
				table.addCell(cell);
			}
		}
		
		if(punishList == null || punishList.size() ==0 ){
			cell = new PdfPCell(new Paragraph("惩罚情况",fontCN));
			table.addCell(cell);
			cell = new PdfPCell(new Paragraph("无记录",fontCN));
			cell.setColspan(4);
			table.addCell(cell);
		}else{
			cell = new PdfPCell(new Paragraph("惩罚情况",fontCN));
			cell.setRowspan(punishList.size());
			table.addCell(cell);
			for(RPInfoValue rpInfo:punishList){
				cell = new PdfPCell(new Paragraph(rpInfo.getStrCreateTime()+"  "+rpInfo.getContents(),fontCN));
				cell.setColspan(4);
				table.addCell(cell);
			}
		}
		
		
		ByteArrayOutputStream buffer = new ByteArrayOutputStream();
		PdfWriter.getInstance(document, buffer);
		document.open();
		document.add(table);
		document.close();
		DataOutput output = new DataOutputStream(response.getOutputStream());
		byte[] bytes = buffer.toByteArray();
		response.setContentLength(bytes.length);
		for(int i=0; i<bytes.length; i++){
			output.writeByte(bytes[i]);
		}
		return null;
	}

	
	public Integer getRecordId() {
		return recordId;
	}

	public void setRecordId(Integer recordId) {
		this.recordId = recordId;
	}

	public Integer getRpId() {
		return rpId;
	}

	public void setRpId(Integer rpId) {
		this.rpId = rpId;
	}

	public String getRpInfoJsonString() {
		return rpInfoJsonString;
	}

	public void setRpInfoJsonString(String rpInfoJsonString) {
		this.rpInfoJsonString = rpInfoJsonString;
	}

	public Integer getStaffId() {
		return staffId;
	}

	public void setStaffId(Integer staffId) {
		this.staffId = staffId;
	}

	public List<StaffInfoValue> getStaffList() {
		return staffList;
	}

	public void setStaffList(List<StaffInfoValue> staffList) {
		this.staffList = staffList;
	}

	public File getStaffPhoto() {
		return staffPhoto;
	}

	public void setStaffPhoto(File staffPhoto) {
		this.staffPhoto = staffPhoto;
	}

	public String getStaffPwd() {
		return staffPwd;
	}

	public void setStaffPwd(String staffPwd) {
		this.staffPwd = staffPwd;
	}

	public IAvatarInfoService getAvatarService() {
		return avatarService;
	}

	public void setAvatarService(IAvatarInfoService avatarService) {
		this.avatarService = avatarService;
	}

	public String getStr() {
		return str;
	}

	public void setStr(String str) {
		this.str = str;
	}

	public String getStaffNo() {
		return staffNo;
	}

	public void setStaffNo(String staffNo) {
		this.staffNo = staffNo;
	}

	public String getArchiveNo() {
		return archiveNo;
	}

	public void setArchiveNo(String archiveNo) {
		this.archiveNo = archiveNo;
	}

	public String getStaffName() {
		return staffName;
	}

	public void setStaffName(String staffName) {
		this.staffName = staffName;
	}

	public String getGender() {
		return gender;
	}

	public void setGender(String gender) {
		this.gender = gender;
	}

	public Integer getAge() {
		return age;
	}

	public void setAge(Integer age) {
		this.age = age;
	}

	public String getBirthday() {
		return birthday;
	}

	public void setBirthday(String birthday) {
		this.birthday = birthday;
	}

	public String getPolitician() {
		return politician;
	}

	public void setPolitician(String politician) {
		this.politician = politician;
	}

	public String getGrade() {
		return grade;
	}

	public void setGrade(String grade) {
		this.grade = grade;
	}

	public String getClassNo() {
		return classNo;
	}

	public void setClassNo(String classNo) {
		this.classNo = classNo;
	}

	public String getTelphone() {
		return telphone;
	}

	public void setTelphone(String telphone) {
		this.telphone = telphone;
	}

	public String getMail() {
		return mail;
	}

	public void setMail(String mail) {
		this.mail = mail;
	}

	public String getDormitory() {
		return dormitory;
	}

	public void setDormitory(String dormitory) {
		this.dormitory = dormitory;
	}

	public Integer getMajorId() {
		return majorId;
	}

	public void setMajorId(Integer majorId) {
		this.majorId = majorId;
	}

	public Integer getSectionId() {
		return sectionId;
	}

	public void setSectionId(Integer sectionId) {
		this.sectionId = sectionId;
	}

	public Integer getPostId() {
		return postId;
	}

	public void setPostId(Integer postId) {
		this.postId = postId;
	}

	public List<SectionInfoValue> getSectionList() {
		return sectionList;
	}

	public void setSectionList(List<SectionInfoValue> sectionList) {
		this.sectionList = sectionList;
	}

	public List<MajorInfoValue> getMajorList() {
		return majorList;
	}

	public void setMajorList(List<MajorInfoValue> majorList) {
		this.majorList = majorList;
	}

	public List<PostInfoValue> getPostList() {
		return postList;
	}

	public void setPostList(List<PostInfoValue> postList) {
		this.postList = postList;
	}

	public ISectionInfoService getSectionService() {
		return sectionService;
	}

	public void setSectionService(ISectionInfoService sectionService) {
		this.sectionService = sectionService;
	}

	public IPostInfoService getPostService() {
		return postService;
	}

	public void setPostService(IPostInfoService postService) {
		this.postService = postService;
	}

	public IMajorInfoService getMajorService() {
		return majorService;
	}

	public void setMajorService(IMajorInfoService majorService) {
		this.majorService = majorService;
	}

	public IMailInfoService getMailService() {
		return mailService;
	}

	public void setMailService(IMailInfoService mailService) {
		this.mailService = mailService;
	}

	public void setArchiveService(IArchiveInfoService archiveService) {
		this.archiveService = archiveService;
	}

	public IArchiveInfoService getArchiveService() {
		return archiveService;
	}

	public void setStaffService(IStaffInfoService staffService) {
		this.staffService = staffService;
	}

	public IStaffInfoService getStaffService() {
		return staffService;
	}

	public void setAvatarId(Integer avatarId) {
		this.avatarId = avatarId;
	}

	public Integer getAvatarId() {
		return avatarId;
	}

	public void setStaffPhotoContentType(String staffPhotoContentType) {
		this.staffPhotoContentType = staffPhotoContentType;
	}

	public String getStaffPhotoContentType() {
		return staffPhotoContentType;
	}

	public void setStaffPhotoFileName(String staffPhotoFileName) {
		this.staffPhotoFileName = staffPhotoFileName;
	}

	public String getStaffPhotoFileName() {
		return staffPhotoFileName;
	}

	public void setSectionName(String sectionName) {
		this.sectionName = sectionName;
	}

	public String getSectionName() {
		return sectionName;
	}

	public void setPostName(String postName) {
		this.postName = postName;
	}

	public String getPostName() {
		return postName;
	}

	public void setMajorName(String majorName) {
		this.majorName = majorName;
	}

	public String getMajorName() {
		return majorName;
	}

	public void setArchiveId(Integer archiveId) {
		this.archiveId = archiveId;
	}

	public Integer getArchiveId() {
		return archiveId;
	}

	public void setMailId(Integer mailId) {
		this.mailId = mailId;
	}

	public Integer getMailId() {
		return mailId;
	}

	public void setRewardList(List<RPInfoValue> rewardList) {
		this.rewardList = rewardList;
	}

	public List<RPInfoValue> getRewardList() {
		return rewardList;
	}

	public void setPunishList(List<RPInfoValue> punishList) {
		this.punishList = punishList;
	}

	public List<RPInfoValue> getPunishList() {
		return punishList;
	}

	public void setRecordList(List<RecordInfoValue> recordList) {
		this.recordList = recordList;
	}

	public List<RecordInfoValue> getRecordList() {
		return recordList;
	}

	public void setRecordService(IRecordInfoService recordService) {
		this.recordService = recordService;
	}

	public IRecordInfoService getRecordService() {
		return recordService;
	}

	public void setRpService(IRPInfoService rpService) {
		this.rpService = rpService;
	}

	public IRPInfoService getRpService() {
		return rpService;
	}

	public void setIsRP(Integer isRP) {
		this.isRP = isRP;
	}

	public Integer getIsRP() {
		return isRP;
	}

	public void setRpCategoryList(List<RPCategoryValue> rpCategoryList) {
		this.rpCategoryList = rpCategoryList;
	}

	public List<RPCategoryValue> getRpCategoryList() {
		return rpCategoryList;
	}

	public void setRpCategoryService(IRPCategoryService rpCategoryService) {
		this.rpCategoryService = rpCategoryService;
	}

	public IRPCategoryService getRpCategoryService() {
		return rpCategoryService;
	}

	public void setRpInfoCategory(Integer rpInfoCategory) {
		this.rpInfoCategory = rpInfoCategory;
	}

	public Integer getRpInfoCategory() {
		return rpInfoCategory;
	}

	public void setCreateTime(String createTime) {
		this.createTime = createTime;
	}

	public String getCreateTime() {
		return createTime;
	}

	public void setContents(String contents) {
		this.contents = contents;
	}

	public String getContents() {
		return contents;
	}

	public void setStaffPwdJsonString(String staffPwdJsonString) {
		this.staffPwdJsonString = staffPwdJsonString;
	}

	public String getStaffPwdJsonString() {
		return staffPwdJsonString;
	}

}
